<div id="page-wrapper">
        <!-- /.row -->
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading"><span class="judul-page">Edit Komponen Pembayaran</span></div>
                <div class="panel-body">
					<?php 
						echo form_open('mr_komp_pembayaran/update', array('class' => 'form-horizontal', 'role' => 'form')); 
					?>
					<input type="hidden" name="id" value="<?php echo $hasil['id_komp']; ?>">
						<div class="form-group">
							<label class="col-sm-2 control-label">Nama Komponen</label>
							<div class="col-sm-4">
								<input type="text" name="nama_komp" value="<?php echo $hasil['nama_komp']?>" class="form-control input-sm" placeholder="Komponen">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">Jenis Komponen</label>
							<div class="col-sm-4">
								<label class="radio-inline">
									<input type="radio" name="jenis_komp" value="sekali" <?php if ($hasil['jenis_komp'] == 'sekali'){echo "checked";} ?>>
									Sekali
								</label>
								
								<label class="radio-inline">
									<input type="radio" name="jenis_komp" value="tahunan" <?php if ($hasil['jenis_komp'] == 'tahunan'){echo "checked";} ?>>
									Tahunan
								</label>

								<label class="radio-inline">
									<input type="radio" name="jenis_komp" value="bulanan" <?php if ($hasil['jenis_komp'] == 'bulanan'){echo "checked";} ?>>
									Bulanan
								</label>
								
								<label class="radio-inline">
									<input type="radio" name="jenis_komp" value="bebas" <?php if ($hasil['jenis_komp'] == 'bebas'){echo "checked";} ?>>
									Bebas
								</label>
							</div>
						</div>
						
                      <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-9">
                          <button type="submit" onClick="validate()" class="btn btn-primary btn-sm">Simpan</button>
                          <button type="reset" class="btn btn-danger btn-sm">Reset</button>
                        </div>
                      </div>
                    <?php 
						echo form_close();
					?>
                </div>
            </div>
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->

<script>
  function validate() {
    $("form").validate({
      rules: {
        nama_komp: {
          required: true
        },
      },
      messages: {
        nama_komp: {
          required: "Nama Komponen harus diisi."
        },
      }
    });

    var topicInputs = topics.find("input").attr("disabled", !inital);
  };
</script>